package com.kgar.controller;


import com.kgar.dto.Result;
import com.kgar.dto.SearchDTO;
import com.kgar.service.JobInfoDocService;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @author Trimb
 */
@RestController
@RequestMapping("/search")
/*
 搜索相关接口

 */
@Lazy
public class SearchController {

    @Resource
    private JobInfoDocService jobInfoDocService;

    @PostMapping("byKeys")
    public Result searchAllJobByKeys(@RequestBody SearchDTO searchDTO){
        return jobInfoDocService.searchWithKeys(searchDTO);
    }

    @PostMapping("byTag")
    public Result searchAllJobByTag(@RequestBody SearchDTO searchDTO){
        return jobInfoDocService.searchWithTag(searchDTO);
    }
    @PostMapping("completion")
    public Result completion(@RequestBody SearchDTO searchDTO){
        return jobInfoDocService.completion(searchDTO);
    }
}
